package cn.hfjava.kz.mapper;

import cn.hfjava.kz.entity.dto.StudentQueryDTO;
import cn.hfjava.kz.entity.excel.StudentExcel;
import cn.hfjava.kz.entity.po.Student;
import cn.hfjava.kz.entity.vo.StudentVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author 86177
* @description 针对表【students(考生表)】的数据库操作Mapper
* @createDate 2024-07-10 09:24:13
* @Entity cn.hfjava.kz.entity.po.Student
*/
@Mapper
public interface StudentMapper extends BaseMapper<Student> {

    List<StudentVO> getStudentVoList(StudentQueryDTO studentQueryDTO);

    long getStudentVoCount(StudentQueryDTO studentQueryDTO);


    void batchInsert(@Param("list") List<Student> list);

    @Select("select * from students ")
    @ResultType(StudentExcel.class)
    List<StudentExcel> getData();

    // 根据 IDs 查询考生数据

    List<StudentExcel> findStudentExcelByIdList(List<Integer> idList);

    List<StudentExcel> findStudentExcelByIdentity(String identity);
    @Select("select id from students where identityId = #{idNum}")
    Integer selectIdByIdNum(String idNum);
}




